package com.barneyx.mshinfoplatform.web.front.info;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.barneyx.mshinfoplatform.common.ExResult;
import com.barneyx.mshinfoplatform.entity.info.InfoCateTagsEntity;
import com.barneyx.mshinfoplatform.service.info.IInfoCateTagsEntityService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/info/cate/tags/")
public class InfoCateTagController {

    @Resource
    private IInfoCateTagsEntityService cateTagService;


    @GetMapping("{cateid}/list")
    public ExResult<?> getCateTagsByCateId(@PathVariable("cateid") String cateId) {
        return ExResult.ofAuto(cateTagService.list(new LambdaQueryWrapper<InfoCateTagsEntity>()
                .eq(InfoCateTagsEntity::getCateId, cateId)));
    }
}

